<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
      
      <f:view>
		<h:head>
		  <title>Theme DarkMedia</title>
		</h:head>
		<h:body style="font-size: 10pt;">
			<h:form id="searchresultform">
				<h:outputText value="Display of the Result via the Primefaces dataList" />
				<br/> 
				<p:dataList style="background-color: white;" id="dataList" type="none" value="#{mediaSearchSampleBean.mediaItems}" var="curMediaItem" varStatus="current" rowIndexVar="iterator">
					<div id="searchresultform:dataList:#{iterator}:divcontainer" style="cursor: pointer; height: 100px; width: 400px; border: 1pt solid black;" onclick="document.getElementById('searchresultform:dataList:#{iterator}:myhiddenCmdLink').click();">
						<h:outputText value="info über Name und Beschreibung und noch andere Dinge....." />
						<br/>
						<h:outputText value="Iterator-Value is: #{iterator}" />
						<p:commandLink id="myhiddenCmdLink" style="display: none;" value="notvisible" action="#{mediaSearchSampleBean.sayHello}" process="@this" update="@this">
							<f:setPropertyActionListener target="#{mediaSearchSampleBean.selectedMediaItem}" value="#{curMediaItem}" />
						</p:commandLink>
					</div> 
				</p:dataList>
				
				<h:outputText value="Display of the Result via the Primefaces dataGrid" />
				<br/>
				<p:dataGrid style="background-color: white;" id="dataGrid" value="#{mediaSearchSampleBean.mediaItems}" var="curMediaItem" rowIndexVar="curRowIdx" columns="1">
					<div id="searchresultform:dataGrid:#{curRowIdx}:divcontainer" onclick="document.getElementById('searchresultform:dataGrid:#{curRowIdx}:myhiddenCmdLink').click();" style="cursor: pointer; height: 100px; width: 400px; border: 1pt solid black;">
						<h:outputText value="info über Name und Beschreibung und noch andere Dinge....." />
						<br/>
						<h:outputText value="Iterator-Value is: #{curRowIdx}" />
						<p:commandLink id="myhiddenCmdLink" style="display: none;" value="notvisible" action="#{mediaSearchSampleBean.sayHello}" process="@this" update="@this">
							<f:setPropertyActionListener target="#{mediaSearchSampleBean.selectedMediaItem}" value="#{curMediaItem}" />
						</p:commandLink>
					</div>
				</p:dataGrid>
	    	</h:form>
		</h:body>
      </f:view>
      
      
</html>